using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Jalal.Library.Web;

/// <summary>
/// Summary description for BasePage
/// </summary>
/// 

namespace Jalal.Library.Web
{
    public class BasePage : System.Web.UI.Page
    {
        protected static string _siteName = string.Empty;
        protected static SiteConfigSection _configSection = null;
        private const int DEFAULT_SETTING_ID = 1;
        public static string siteRoot;

        public string SiteRoot
        {
            get
            {
                return ResolveUrl("~");
            }
        }

        public static SiteConfigSection ConfigSection
        {
            get
            {
                if (_configSection == null)
                    _configSection = SiteConfigSection.SiteConfiguration;

                return _configSection;
            }
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ViewStateUserKey = Session.SessionID;
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            SiteMapNode siteMapNode = SiteMap.CurrentNode;
            Title = siteMapNode.Title;
            siteRoot = SiteRoot;
        }

        protected string ThemeFolder
        {
            get { return "~/App_Themes/" + Page.Theme; }
        }
    }
}
